local sk__jiexin = fk.CreateSkill {

  name = "sk__jiexin",

  tags = {},

}



sk__jiexin:addEffect(fk.Damaged, {
  name = "sk__jiexin",
  anim_type = "masochism",
  can_trigger = function(self, event, target, player, data)
    return target == player and player:hasSkill(sk__jiexin.name)
  end,
  on_cost = function(self, event, target, player, data)
    local room = player.room
    local sk__tiance=Fk.skills["sk__tiance"]
    return player.room:askForSkillInvoke(player, sk__jiexin.name) and
        sk__tiance:cost(event, target, player, { extra_data = sk__jiexin.name })
  end,
  on_use = function(self, event, target, player, data)
    local sk__tiance=Fk.skills["sk__tiance"]
    local event2=fk.EventPhaseStart:new(player.room,player,{})
    player.room:useSkill(player, sk__tiance, function()
      return sk__tiance:use(event, target, player, data)
    end)
    if not player.dead and event:getCostData(sk__tiance) == sk__jiexin.name then
      sk__tiance:trigger(event2, target, player, data)
    end
  end,
})

return sk__jiexin
